﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>出差休假</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />

    <link href="/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="/CSS/Base/BaseClass.css?cssver=4" rel="stylesheet" type="text/css" />
    <link href="/CSS/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet">
    <script src="/Scripts/jquery-1.11.2.min.js"></script>
    <script src="/Scripts/avalon.min.js"></script> 
    <script src="/Scripts/SZHLCommon.js?jsver=5"></script>
    <script>
        var model = avalon.define({
            $id: "APP_CCXJ_LCSZ",
            modelData: { PDId: 1, spRole: "", spRole2: "", isEnable: "",IsDetailUser:"N" },
            RoleData: [],
            render: function () {

            },
            AddLCSZ: function () {
                model.modelData.isEnable = $("#chkEnable").prop("checked");
                var modelValue = JSON.stringify(model.modelData.$model);
                $.post("/API/FTAPI.ashx", { Action: "MODITYDF", P1: modelValue },
                function (result) {
                    if ($.trim(result.ErrorMsg) != "") {
                        parent.ComFunJS.winwarning(result.ErrorMsg);
                    } else {
                        parent.ComFunJS.winsuccess("设置成功");
                    }
                });
            }
        })
        avalon.ready(function () {
            $.getJSON('/API/SZHLAPI.ashx?Action=GETROLE', function (resultData) {
                model.RoleData = resultData.Result;
            })
            $.getJSON('/API/FTAPI.ashx?Action=GETDFLIST', { P1: 1 }, function (resultData) {
                if (resultData.ErrorMsg == "") {
                    model.modelData.spRole = resultData.Result[0].AssignedRole == "-1" ? "" : resultData.Result[0].AssignedRole;
                    model.modelData.spRole2 = resultData.Result[1].AssignedRole == "-1" ? "" : resultData.Result[1].AssignedRole;
                    model.modelData.isEnable = resultData.Result[1].isforbid;
                    model.modelData.IsDetailUser = resultData.Result[0].IsDetailUser == "" ? "N" : resultData.Result[0].IsDetailUser;
                }
            })

        })
    </script>
</head>
<body ms-controller="APP_CCXJ_LCSZ">
    <div class="container-fluid maindiv" style="margin-top: 20px" id="dvContent">
        <div class="row contentdv" style="margin-left:20px">
            <div class="col-xs-12 ">
                <div class="panel panel-default">
                    <div class="panel-heading"><span>审核步骤：一</span></div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label>第一级审核角色</label>
                            <select class="form-control" ms-duplex="modelData.spRole">
                                <option value="">请选择</option>
                                <option ms-repeat-item="RoleData" ms-attr-value="item.RoleCode" ms-attr-selected="item.RoleCode==SelRoleItem.RoleCode?'selected':''">{{item.RoleName}}</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label>是否具体到详细部门</label>
                            <select id="isUse" class="form-control" style="width:30%" ms-duplex="modelData.IsDetailUser">
                                <option value="Y" ms-attr-selected="modelData.IsDetailUser=='Y'?'selected':''">是</option>
                                <option value="N" ms-attr-selected="modelData.IsDetailUser=='N'?'selected':''">否</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <span>审核步骤：二</span>
                        <label style="float:right">
                            <input type="checkbox" ms-attr-checked="modelData.isEnable=='N'" ms-duplex="modelData.isEnable" id="chkEnable">禁用
                        </label>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label for="exampleInputEmail1">第二级审核角色</label>
                            <select class="form-control" ms-duplex="modelData.spRole2">
                                <option value="">请选择</option>
                                <option ms-repeat-item="RoleData" ms-attr-value="item.RoleCode" ms-attr-selected="item.RoleCode==SelRoleItem.RoleCode?'selected':''">{{item.RoleName}}</option>
                            </select>
                        </div>
                    </div>
                </div>
                <button class="btn btn-default" ms-click="AddLCSZ()">保存数据</button>
            </div>
        </div>
        </div>
    <script src="/CSS/bootstrap3.3.5/js/bootstrap.js" type="text/javascript"></script>
    <link href="/JqueryPlug/umeditor122/themes/default/css/umeditor.css" type="text/css" rel="stylesheet" />
    <script src="/JqueryPlug/umeditor122/umeditor.js" type="text/javascript" charset="utf-8"></script>
    <script src="/JqueryPlug/umeditor122/umeditor.config.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
